import request from '@/utils/request'

export function getRoleList(data) {
  // 将 data 对象转换为查询字符串
  const params = new URLSearchParams(data).toString()
  // 发起 GET 请求，将 params 添加到 URL 中
  return request({
    url: `/admin/api/role/getList?${params}`,
    method: 'get',
  })
}

export function getRoleAllList(data) {
  return request({
    url: `/admin/api/role/getAll`,
    method: 'get',
  })
}

export function doEdit(data) {
  return request({
    url: '/admin/api/role/addRole',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/admin/api/role/delAll',
    method: 'post',
    data,
  })
}
